package v1

import (
	"github.com/gin-gonic/gin"
	"hytx_media/service/index_service"
	"hytx_media/models"
	"hytx_media/pkg/app"
	"net/http"
	"hytx_media/pkg/e"
)

//首页

//各种数量
func Quantity(c *gin.Context) {
	user := c.MustGet("user").(*models.MediaUser)
	ag := app.Gin{C:c}

	data := index_service.GetNumber(user.ID)
	ag.Response(http.StatusOK, e.SUCCESS, data)
}

//首页通知
func Notice(c *gin.Context) {
	//user := c.MustGet("user").(*models.MediaUser)
	ag := app.Gin{C:c}

	data := index_service.GetNotice()

	ag.Response(http.StatusOK, e.SUCCESS, data)
}

/**
	幻灯片
 */
func Slides(c *gin.Context) {
	ag := app.Gin{C:c}
	data := index_service.GetSlides()
	ag.Response(http.StatusOK, e.SUCCESS, data)
}

func NewArticles(c *gin.Context) {
	user := c.MustGet("user").(*models.MediaUser)
	ag := app.Gin{C:c}
	data := index_service.GetNewArticles(user.ID)
	ag.Response(http.StatusOK, e.SUCCESS, data)
}
